<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html>
<html>
<head>
    <title>发布新课程</title>
    <style>
        body { background: #23272e; font-family: 'Microsoft YaHei', Arial, sans-serif; }
        .sidebar {
            position: fixed;
            top: 0; left: 0; bottom: 0;
            width: 200px;
            background: #181a20;
            padding-top: 60px;
            box-shadow: 2px 0 8px rgba(0,0,0,0.15);
            display: flex;
            flex-direction: column;
            align-items: center;
        }
        .sidebar ul {
            list-style: none; padding: 0; margin: 0; width: 100%;
        }
        .sidebar li {
            width: 100%;
        }
        .sidebar a {
            display: block;
            color: #e0e0e0;
            text-decoration: none;
            font-size: 18px;
            padding: 18px 0 18px 40px;
            transition: background 0.2s, color 0.2s;
        }
        .sidebar a:hover, .sidebar a.active {
            background: #2d313a;
            color: #4fc3f7;
        }
        .sidebar .logout {
            color: #ff8a65;
            margin-top: 40px;
            padding-left: 40px;
        }
        .container {
            width: 900px;
            margin: 60px auto 0 240px; /* Adjusted margin for sidebar */
            background: #181a20; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.3); padding: 40px; color: #b0b8c1; }
        h2 { margin-bottom: 30px; color: #fff; text-align: center; }
        .form-group { margin-bottom: 20px; }
        .form-group label { display: block; margin-bottom: 8px; color: #b0b8c1; }
        .form-group input[type="text"],
        .form-group textarea,
        .form-group select {
            width: 100%;
            padding: 10px;
            border: 1px solid #2d313a;
            border-radius: 4px;
            background: #2d313a;
            color: #fff;
            box-sizing: border-box;
        }
        .btn-submit {
            width: 100%;
            padding: 12px;
            border: none;
            border-radius: 4px;
            background: #43a047;
            color: #fff;
            font-size: 16px;
            cursor: pointer;
            transition: background 0.3s ease;
        }
        .btn-submit:hover {
            background: #5cb85c;
        }
        .message { margin-top: 20px; padding: 10px; border-radius: 5px; }
        .success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
        .error { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
    </style>
</head>
<body>
<div class="sidebar">
    <ul>
        <li><a href="guanliyuan_index.jsp">首页</a></li>
        <li><a href="guanliyuan_student_manage">学生账号管理</a></li>
        <li><a href="guanliyuan_teacher_manage">老师账号管理</a></li>
        <li><a href="guanliyuan_publish_course" class="active">发布课程</a></li>
        <li><a href="guanliyuan_course_manage">管理课程</a></li>
    </ul>
    <a href="logout" class="logout">退出登录</a>
</div>
<div class="container">
    <h2>发布新课程</h2>
    <form action="guanliyuan_publish_course" method="post">
        <div class="form-group">
            <label for="courseName">课程名称:</label>
            <input type="text" id="courseName" name="courseName" required>
        </div>
        <div class="form-group">
            <label for="courseDescription">课程描述:</label>
            <textarea id="courseDescription" name="courseDescription" rows="5"></textarea>
        </div>
        <div class="form-group">
            <label for="teacherName">授课老师:</label>
            <input type="text" id="teacherName" name="teacherName" placeholder="请输入老师姓名" required>
        </div>
        <div class="form-group">
            <label for="maxCapacity">最大容量:</label>
            <input type="text" id="maxCapacity" name="maxCapacity" required>
        </div>
        <button type="submit" class="btn-submit">发布课程</button>
    </form>
    <c:if test="${not empty errorMessage}">
        <p class="message error"><c:out value="${errorMessage}"/></p>
    </c:if>
    <c:if test="${not empty successMessage}">
        <p class="message success"><c:out value="${successMessage}"/></p>
    </c:if>
</div>
</body>
</html> 